package com.training.java.core.collections.post15;

import java.util.LinkedHashSet;
import java.util.Set;

/**
 * 
 * This demo is to observe how LinkedHashSet is displaying the values. Should
 * not take duplicates. Should not take null. Observe that LinkedHashSet is
 * maintaining the order that you add.
 * 
 * @author soumya
 * 
 */
public class LaptopLinkedHashSetDemo {

	public static void main(String[] args) {

		Laptops lenovo = new Laptops("Lenovo", "T410", 11);
		Laptops dell = new Laptops("Dell", "Inspiron", 12);
		Laptops mac = new Laptops("Mac", "Retina", 13);
		Laptops lenovo2 = new Laptops("Lenovo", "T410", 12);
		Laptops lenovo3 = new Laptops("Lenovo", "T410", 13);

		Set<Laptops> laptops = new LinkedHashSet<Laptops>();

		laptops.add(lenovo);
		laptops.add(dell);
		laptops.add(mac);
		laptops.add(lenovo2);
		laptops.add(lenovo3);

		for (Laptops laptopA : laptops) {

			System.out.println(" Laptop make : " + laptopA.getMake());
			System.out.println(" Laptop model : " + laptopA.getModel());
			System.out.println(" Laptop screenSize : "
					+ laptopA.getScreenSize());
			System.out.println(" ");
		}

	}

}
